import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/pvm/teacher/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/pvm/teacher',
    method: 'post',
    data: obj
  })
}

export function getTeacherObj(id) {
  return request({
    url: '/pvm/teacher/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/pvm/teacher/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/pvm/teacher',
    method: 'put',
    data: obj
  })
}

//  查询教师编号是否存在
export function checkTeacherCode(schoolId,teacherCode){
  return request({
    url: '/pvm/teacher/' + schoolId + '/' + teacherCode,
    method: 'get'
  })
}
